using System.Web.Mvc;
using Newtonsoft.Json.Linq;

namespace WineCellar.Web.Helpers
{
    public class JObjectResult : ActionResult
    {
        private readonly JObject o;

        public JObjectResult(JObject o)
        {
            this.o = o;
        }

        public override void ExecuteResult(ControllerContext context)
        {
            //context.HttpContext.Response.ContentType = "application/json"; //jquery forms can't handle this
            context.HttpContext.Response.StatusCode = 200;
            context.HttpContext.Response.Write(o);
        }
    }
}